const getters = {
  sidebar: state => state.app.sidebar,
  size: state => state.app.size,
  device: state => state.app.device,
  visitedViews: state => state.tagsView.visitedViews,
  cachedViews: state => state.tagsView.cachedViews,
  token: state => state.user.token,
  name: state => state.user.name,
  deptName: state => state.user.deptName,
  mutiDept: state => state.user.mutiDept,
  canChangeDept: state => state.user.canChangeDept,
  permissions_btnList: state => state.user.permissions,
  permissions: state => state.user.permissions,
  permission_routes: state => state.permission.routes,
  sidebarRouters:state => state.permission.sidebarRouters,
  searchMenuList:state => state.permission.searchMenuList,
  admin: state => state.user.admin,
  // 是否多租户
  multipleCorporate: state => state.user.multipleCorporate,
  // 全局管理员
  globalAdmin: state => !state.user.tenantCode,
  // 租户管理员
  tenantAdmin: (state) => {
    return (state.user.admin && (state.user.tenantCode ? true : false))
  },
  // 普通用户
  normalUser: state => !state.user.admin,
  crypto: state => {

    //state.crypto.crypto
    return window.localStorage.getItem('crypto') ? JSON.parse(window.localStorage.getItem('crypto')) : undefined
  },
  sign: state => {

    //state.crypto.sign
    return window.localStorage.getItem('sign') ? JSON.parse(window.localStorage.getItem('sign')) : undefined
  },
  // cnaps 全局业务信息
  globalBusData: state => state.cnaps.globalBusData,
}
export default getters
